package com.example.flower_shop.websocket;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/chat")
@Tag(name = "客服聊天接口")
public class ChatController {

    @Resource
    private WebSocket webSocket;

    @PostMapping("/send")
    @Operation(summary = "发送消息")
    public void sendTo(MessageReq messageReq) {
        webSocket.sendMessage(messageReq);
    }
}
